/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.cms.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.cms.entity.DataType;
import com.thinkgem.jeesite.modules.cms.dao.DataTypeDao;

/**
 * 键值对Service
 * @author leo
 * @version 2017-03-01
 */
@Service
@Transactional(readOnly = true)
public class DataTypeService extends CrudService<DataTypeDao, DataType> {

	public DataType get(String id) {
		return super.get(id);
	}
	
	public List<DataType> findList(DataType dataType) {
		return super.findList(dataType);
	}
	
	public Page<DataType> findPage(Page<DataType> page, DataType dataType) {
		return super.findPage(page, dataType);
	}
	
	@Transactional(readOnly = false)
	public void save(DataType dataType) {
		super.save(dataType);
	}
	
	@Transactional(readOnly = false)
	public void delete(DataType dataType) {
		super.delete(dataType);
	}

	public List<DataType> getByType(String type) {
		List<DataType>  data = new ArrayList();
		data = ((DataTypeDao)dao).getByType(type);
		
		return data;
	}
	
}